package net.huashitong.synthetical.question.service;

import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.sys.base.StringPKService;
import com.sirdc.modules.sys.service.SysTableService;
import net.huashitong.synthetical.question.dao.CoordinateDao;
import net.huashitong.synthetical.question.entity.Coordinate;
import net.huashitong.synthetical.question.filter.CoordinateFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

//问题处理
@Service
public class CoordinateService extends StringPKService<Coordinate> {

    @Autowired
    private CoordinateDao dao;

    @Autowired
    SysTableService tableService;



    @Override
    protected BaseDao<Coordinate, String> getDao() {
        return dao;
    }

    @Override
    protected void beforeSave(Coordinate obj) {
        obj.setSysId(tableService.updateMaxSysId("t_question", null));
    }

    public List<Coordinate> queryAll(CoordinateFilter filter) {
        return dao.queryAllCoordinate(filter);
    }

//条件搜索

    public List<Coordinate> queryCoordinate(CoordinateFilter filter) {
        return dao.queryCoordinate(filter);
    }
}
